<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport"
			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../css/mui.css" rel="stylesheet" />
		<link href="../../fonticon/iconfont.css" rel="stylesheet" />
		<link rel="stylesheet" href="../../css/header.css" />
	</head>

	<body>

		<header class="mui-bar mui-bar-nav title">
			<h1 class="mui-title title-color" id="taoxin_title"><b>实习派</b></h1>
		</header>

		<nav class="mui-bar mui-bar-tab">
			<a class="mui-tab-item mui-active" tabindex="0">
				<span class="mui-icon iconfont icon-fangdajingfuben"></span>
				<span class="mui-tab-label">用户管理</span>
			</a>
			<a class="mui-tab-item" tabindex="1">
				<span class="mui-icon iconfont icon-ziliao"></span>
				<span class="mui-tab-label">实习资料管理</span>
			</a>
			<a class="mui-tab-item" tabindex="2">
				<span class="mui-icon iconfont icon-gonggao"></span>
				<span class="mui-tab-label">公告管理</span>
			</a>
			<a class="mui-tab-item" tabindex="3">
				<span class="mui-icon iconfont icon-shuju"></span>
				<span class="mui-tab-label">数据统计分析</span>
			</a>
		</nav>

		<script src="../../js/mui.min.js"></script>

		<script type="text/javascript">
			mui.init();
			
			mui.plusReady(function() {
				// 禁止返回到登录注册页面
				mui.back = function() {
					return false;
				}
				plus.navigator.setStatusBarStyle("light");
				plus.navigator.setStatusBarBackground("#3399FF");
			});
			
			var managerArray = [{
					pageId: "userManage.html",
					pageUrl: "userManage.html"
				},
				{
					pageId: "materialManage.html",
					pageUrl: "materialManage.html"
				},
				{
					pageId: "noticeManage.html",
					pageUrl: "noticeManage.html"
				},
				{
					pageId: "dataAnalysis.html",
					pageUrl: "../common/dataAnalysis.html"
				}
			];

			var managerStyle = {
				top: "44px",
				bottom: "50px"
			};

			mui.plusReady(function() {
				// 获取当前的WebView对象
				var indexWebView = plus.webview.currentWebview();

				// 向当前的主页webview追加子页的4张webview对象
				for (var i = 0; i < managerArray.length; i++) {
					var managerPage = plus.webview.create(managerArray[i].pageUrl, managerArray[i].pageId, managerStyle);
					// 隐藏webview窗口
					managerPage.hide();
					// 追加每一个子页面到当前主页面
					indexWebView.append(managerPage);
				}

				plus.webview.show(managerArray[0].pageId);

				// 批量绑定tap事件，展示不同的页面
				mui(".mui-bar-tab").on("tap", "a", function() {
					var tabindex = this.getAttribute("tabindex");
					// 显示点击的tab选项所对应的页面
					plus.webview.show(managerArray[tabindex].pageId, "fade-in", 200);

					// 隐藏其他的不需要的页面
					for (var i = 0; i < managerArray.length; i++) {
						if (i != tabindex) {
							plus.webview.hide(managerArray[i].pageId, "fade-out", 200);
						}
					}
				})

				//setTimeout("initData()", "1000");
			})
		</script>


	</body>

</html>
